﻿using Newtonsoft.Json;
using Pay.Core;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.DTO
{
    /// <summary>
    /// 消费商品表 mc_ConsumeProduct
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class consume_product_dto
    {
        /// <summary>
        /// 消费商品Id
        /// </summary>
        public long id { get; set; }

        /// <summary>
        /// 商品标题
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 商品介绍
        /// </summary>
        public string detail { get; set; }

        /// <summary>
        /// 图片Url
        /// </summary>
        public string img_url { get; set; }

        /// <summary>
        /// 兑换红钻数量
        /// </summary>
        public decimal red_drill { get; set; }

        /// <summary>
        /// 状态(1:正常,2:下架)
        /// </summary>
        public EConsumeProductStatus status { get; set; }

        /// <summary>
        /// 状态枚举描述
        /// </summary>
        public string status_title { get { return this.status.ToDescription(); } }

        /// <summary>
        /// 商品兑换剩余数量限制（为空则不限制）
        /// </summary>
        public int? product_num_limit { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime update_time { get; set; }
        /// <summary>
        /// 销售价
        /// </summary>
        public decimal sale_price { get; set; }
        /// <summary>
        /// 市场价
        /// </summary>
        public decimal market_price { get; set; }
        /// <summary>
        /// 待发货数量
        /// </summary>
        public int to_shipping_num { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int sort { get; set; }

        /// <summary>
        /// 开始兑换时间
        /// </summary>
        public DateTime? begin_time { get; set; }
    }

    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class consume_product_dto_ex : consume_product_dto
    {
        /// <summary>
        /// 状态枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_status_list
        {
            get { return typeof(EConsumeProductStatus).GetDropdownItemList(); }
        }
        /// <summary>
        /// 状态类型枚举值
        /// </summary>
        public string status_value { get; set; }
    }

    /// <summary>
    /// app商品兑换
    /// </summary>
    [Serializable]
    public class app_consume_product_dto
    {
        /// <summary>
        /// 消费商品Id
        /// </summary>
        public long id { get; set; }

        /// <summary>
        /// 商品标题
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 商品介绍
        /// </summary>
        public string detail { get; set; }

        /// <summary>
        /// 图片Url
        /// </summary>
        public string img_url { get; set; }

        /// <summary>
        /// 兑换红钻数量
        /// </summary>
        public decimal red_drill { get; set; }
        /// <summary>
        /// 销售价
        /// </summary>
        public decimal sale_price { get; set; }
        /// <summary>
        /// 市场价
        /// </summary>
        public decimal market_price { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int sort { get; set; }
        /// <summary>
        /// 状态(1:正常,2:下架,3已售馨,4即将开放)
        /// [长度：10]
        /// [不允许为空]
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 开始兑换时间
        /// </summary>
        public string begin_time { get; set; }
    }

    /// <summary>
    /// App 商品兑换Model
    /// </summary>
    public class exchange_product_model
    {
        /// <summary>
        /// 商品Id
        /// </summary>
        public long product_id { get; set; }

        /// <summary>
        /// 前端显示所需红钻,若后台变更,和前端显示不一致,提醒用户刷新
        /// </summary>
        public decimal red_drill { get; set; }
        /// <summary>
        /// 收货地址id
        /// </summary>
        public long? ship_adress_id { get; set; }
    }
}
